package org.cpoy.eims.entity;

// Generated Feb 24, 2011 8:45:00 AM by Hibernate Tools 3.3.0.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Teacher generated by hbm2java
 */
@Entity
@Table(name = "teacher")
public class Teacher implements java.io.Serializable {

	private int id;
	private UserAccount userAccount;
	private Address addressByPresentAddressId;
	private Address addressByPermanentAddressId;
	private String firstName;
	private String lastName;
	private String passportPhotoUrl;
	private String subject;
	private Date dateOfBirth;
	private String qualification;
	private int mobileNumber;
	private Integer contactNumberInCaseOfEmergency;
	private String comments;
	private Set<Course> courses = new HashSet<Course>(0);

	public Teacher() {
	}

	public Teacher(int id, UserAccount userAccount, Address addressByPresentAddressId,
			String firstName, String lastName, String passportPhotoUrl,
			String subject, Date dateOfBirth, String qualification,
			int mobileNumber) {
		this.id = id;
		this.userAccount = userAccount;
		this.addressByPresentAddressId = addressByPresentAddressId;
		this.firstName = firstName;
		this.lastName = lastName;
		this.passportPhotoUrl = passportPhotoUrl;
		this.subject = subject;
		this.dateOfBirth = dateOfBirth;
		this.qualification = qualification;
		this.mobileNumber = mobileNumber;
	}

	public Teacher(int id, UserAccount userAccount, Address addressByPresentAddressId,
			Address addressByPermanentAddressId, String firstName,
			String lastName, String passportPhotoUrl, String subject,
			Date dateOfBirth, String qualification, int mobileNumber,
			Integer contactNumberInCaseOfEmergency, String comments,
			Set<Course> courses) {
		this.id = id;
		this.userAccount = userAccount;
		this.addressByPresentAddressId = addressByPresentAddressId;
		this.addressByPermanentAddressId = addressByPermanentAddressId;
		this.firstName = firstName;
		this.lastName = lastName;
		this.passportPhotoUrl = passportPhotoUrl;
		this.subject = subject;
		this.dateOfBirth = dateOfBirth;
		this.qualification = qualification;
		this.mobileNumber = mobileNumber;
		this.contactNumberInCaseOfEmergency = contactNumberInCaseOfEmergency;
		this.comments = comments;
		this.courses = courses;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	@NotNull
	public UserAccount getUserAccount() {
		return this.userAccount;
	}

	public void setUserAccount(UserAccount userAccount) {
		this.userAccount = userAccount;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "present_address_id", nullable = false)
	@NotNull
	public Address getAddressByPresentAddressId() {
		return this.addressByPresentAddressId;
	}

	public void setAddressByPresentAddressId(Address addressByPresentAddressId) {
		this.addressByPresentAddressId = addressByPresentAddressId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "permanent_address_id")
	public Address getAddressByPermanentAddressId() {
		return this.addressByPermanentAddressId;
	}

	public void setAddressByPermanentAddressId(
			Address addressByPermanentAddressId) {
		this.addressByPermanentAddressId = addressByPermanentAddressId;
	}

	@Column(name = "first_name", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Column(name = "last_name", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(name = "passport_photo_url", nullable = false, length = 150)
	@NotNull
	@Length(max = 150)
	public String getPassportPhotoUrl() {
		return this.passportPhotoUrl;
	}

	public void setPassportPhotoUrl(String passportPhotoUrl) {
		this.passportPhotoUrl = passportPhotoUrl;
	}

	@Column(name = "subject", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getSubject() {
		return this.subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "date_of_birth", nullable = false, length = 10)
	@NotNull
	public Date getDateOfBirth() {
		return this.dateOfBirth;
	}

	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	@Column(name = "qualification", nullable = false, length = 16777215)
	@NotNull
	@Length(max = 16777215)
	public String getQualification() {
		return this.qualification;
	}

	public void setQualification(String qualification) {
		this.qualification = qualification;
	}

	@Column(name = "mobile_number", nullable = false)
	public int getMobileNumber() {
		return this.mobileNumber;
	}

	public void setMobileNumber(int mobileNumber) {
		this.mobileNumber = mobileNumber;
	}

	@Column(name = "contact_number_in_case_of_emergency")
	public Integer getContactNumberInCaseOfEmergency() {
		return this.contactNumberInCaseOfEmergency;
	}

	public void setContactNumberInCaseOfEmergency(
			Integer contactNumberInCaseOfEmergency) {
		this.contactNumberInCaseOfEmergency = contactNumberInCaseOfEmergency;
	}

	@Column(name = "comments", length = 16777215)
	@Length(max = 16777215)
	public String getComments() {
		return this.comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<Course> getCourses() {
		return this.courses;
	}

	public void setCourses(Set<Course> courses) {
		this.courses = courses;
	}

}
